﻿<UserControl x:Class="SABnzbdNET.Views.ServerStatus"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             Loaded="UserControl_Loaded"
             mc:Ignorable="d" d:DesignHeight="325" d:DesignWidth="500">
    <Grid>
        <GroupBox Name="grpStatus" HorizontalAlignment="Stretch" Height="150" VerticalAlignment="Top" Header="Server status" >
            <Grid>
                <Image Height="125" HorizontalAlignment="Right" Name="imgBackground" Opacity="0.25" Stretch="Uniform" VerticalAlignment="Top" Width="200">
                    <Image.Source>
                        <BitmapImage UriSource="/SABnzbdNET;component/Graphics/SABnzbd.jpg"></BitmapImage>
                    </Image.Source>
                </Image>
                <Label Height="25" HorizontalAlignment="Left" Margin="0,0,0,0" Name="lblServer" VerticalAlignment="Top" Width="120">Server</Label>
                <TextBlock  VerticalAlignment="Top" Height="20" HorizontalAlignment="Stretch" Margin="106,5,125,0" >
                   <Hyperlink RequestNavigate="hlnServer_RequestNavigate" Name="hlnServer" NavigateUri="{Binding Source={StaticResource Settings}, Path=Default.ServerPath}">
                       <Run Text="{Binding Source={StaticResource Settings}, Path=Default.ServerPath}" />
                   </Hyperlink>
                </TextBlock>
                <Label Height="25" HorizontalAlignment="Left" Margin="0,25,0,0" Name="lblStatus" VerticalAlignment="Top" Width="120">Status</Label>
                <Label Height="25" HorizontalAlignment="Stretch" Margin="100,25,125,0" Name="lblStatusValue" VerticalAlignment="Top">N/A</Label>
                <Label Height="25" HorizontalAlignment="Left" Margin="0,50,0,0" Name="lblTitle" VerticalAlignment="Top" Width="120">Current title</Label>
                <Label Height="25" HorizontalAlignment="Stretch" Margin="100,50,125,0" Name="lblTitleValue" VerticalAlignment="Top">N/A</Label>
                <Label Height="25" HorizontalAlignment="Left" Margin="0,75,0,0" Name="lblSpeed" VerticalAlignment="Top" Width="120">Download speed</Label>
                <Label Height="25" HorizontalAlignment="Stretch" Margin="100,75,125,0" Name="lblSpeedValue" VerticalAlignment="Top">N/A</Label>
                <Label Height="25" HorizontalAlignment="Left" Margin="0,100,0,0" Name="lblProgress" VerticalAlignment="Top" Width="120">Progress</Label>
                <ProgressBar Height="15" Margin="105,105,125,0" Name="progressBar" VerticalAlignment="top" />
            </Grid>
        </GroupBox>
        <GroupBox Name="grpDownloads" HorizontalAlignment="Stretch" Height="165" VerticalAlignment="Bottom" Header="Current downloads" >
            <Grid>
                <ListView Margin="0,0,0,0" Name="listViewQueue" VerticalAlignment="Stretch">
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Width="275" Header="Title" DisplayMemberBinding="{Binding Title}" />
                            <GridViewColumn Width="75"  Header="Size">
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <TextBlock Width="60" TextAlignment="Right" Text="{Binding Size, StringFormat=N2}"/>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                            <GridViewColumn Width="158" Header="Progress">
                                <GridViewColumn.CellTemplate>
                                    <DataTemplate>
                                        <ProgressBar Width="145" Height="15" Value="{Binding Progress}" ToolTip="{Binding Progress}"/>
                                    </DataTemplate>
                                </GridViewColumn.CellTemplate>
                            </GridViewColumn>
                        </GridView>
                    </ListView.View>
                </ListView>
            </Grid>
        </GroupBox>
    </Grid>
</UserControl>
